#pragma once
#include <QtCore/QObject>
#include <QtGui/QPixmap>
#include "Serializable.h"

class SkillModel;
class ExtraordinaryAbilityModel;
class WeaponProficiencyModel;
class EquipmentModel;

// --------------------------------------------------------------------------------
// CharacterModel class
//
// Designed as a simple container for the attributes of a character
// --------------------------------------------------------------------------------
class CharacterModel :
	public Serializable
{
	 Q_OBJECT
	 Q_PROPERTY(QString Name READ Name WRITE setName)
	 Q_PROPERTY(QString Alignment READ Alignment WRITE setAlignment)
	 Q_PROPERTY(QString Occupation READ Occupation WRITE setOccupation)
	 Q_PROPERTY(QString Type READ Type WRITE setType)
	 Q_PROPERTY(int IQ READ IQ WRITE setIQ)
	 Q_PROPERTY(int ME READ ME WRITE setME)
	 Q_PROPERTY(int MA READ MA WRITE setMA)
	 Q_PROPERTY(int PS READ PS WRITE setPS)
	 Q_PROPERTY(int PP READ PP WRITE setPP)
	 Q_PROPERTY(int PE READ PE WRITE setPE)
	 Q_PROPERTY(int PB READ PB WRITE setPB)
	 Q_PROPERTY(int SPD READ SPD WRITE setSPD)
	 Q_PROPERTY(int HP READ HP WRITE setHP)
	 Q_PROPERTY(int SDC READ SDC WRITE setSDC)
	 Q_PROPERTY(QString HandToHandType READ HandToHandType WRITE setHandToHandType)
	 Q_PROPERTY(int NumAttacks READ NumAttacks WRITE setNumAttacks)
	 Q_PROPERTY(int Strike READ Strike WRITE setStrike)
	 Q_PROPERTY(int Damage READ Damage WRITE setDamage)
	 Q_PROPERTY(int Kick READ Kick WRITE setKick)
	 Q_PROPERTY(int Parry READ Parry WRITE setParry)
	 Q_PROPERTY(int Roll READ Roll WRITE setRoll)
	 Q_PROPERTY(int Dodge READ Dodge WRITE setDodge)
	 Q_PROPERTY(int Critical READ Critical WRITE setCritical)
	 Q_PROPERTY(int CurrentHP READ CurrentHP WRITE setCurrentHP)
	 Q_PROPERTY(int CurrentSDC READ CurrentSDC WRITE setCurrentSDC)
	 Q_PROPERTY(QString Special READ Special WRITE setSpecial)
	 Q_PROPERTY(QString SaveBonus READ SaveBonus WRITE setSaveBonus)
	 Q_PROPERTY(QString Notes READ Notes WRITE setNotes)
	 Q_PROPERTY(QByteArray Image READ Image WRITE setImage STORED false)
	 Q_PROPERTY(QList<SkillModel *> PrimarySkills READ PrimarySkills WRITE setPrimarySkills STORED false)
	 Q_PROPERTY(QList<SkillModel *> SecondarySkills READ SecondarySkills WRITE setSecondarySkills STORED false)
	 Q_PROPERTY(QList<ExtraordinaryAbilityModel *> ExtraordinaryAbilities READ ExtraordinaryAbilities WRITE setExtraordinaryAbilities STORED false)
	 Q_PROPERTY(QList<WeaponProficiencyModel *> WeaponProficiencies READ WeaponProficiencies WRITE setWeaponProficiencies STORED false)
	 Q_PROPERTY(QList<EquipmentModel *> Equipment READ Equipment WRITE setEquipment STORED false)

#pragma region Constructor

public:
	CharacterModel(void);
	~CharacterModel(void);

#pragma endregion

#pragma region Properties and Fields

	Q_PROP_DECL(QString, Name)
	Q_PROP_DECL(QString, Alignment)
	Q_PROP_DECL(QString, Occupation)
	Q_PROP_DECL(QString, Type)
	Q_PROP_DECL(QByteArray, Image)
	Q_PROP_DECL(int, IQ)
	Q_PROP_DECL(int, ME)
	Q_PROP_DECL(int, MA)
	Q_PROP_DECL(int, PS)
	Q_PROP_DECL(int, PP)
	Q_PROP_DECL(int, PE)
	Q_PROP_DECL(int, PB)
	Q_PROP_DECL(int, SPD)
	Q_PROP_DECL(int, HP)
	Q_PROP_DECL(int, SDC)
	Q_PROP_DECL(QString, HandToHandType)
	Q_PROP_DECL(int, NumAttacks)
	Q_PROP_DECL(int, Strike)
	Q_PROP_DECL(int, Damage)
	Q_PROP_DECL(int, Kick)
	Q_PROP_DECL(int, Parry)
	Q_PROP_DECL(int, Roll)
	Q_PROP_DECL(int, Dodge)
	Q_PROP_DECL(int, Critical)
	Q_PROP_DECL(int, CurrentHP)
	Q_PROP_DECL(int, CurrentSDC)
	Q_PROP_DECL(QString, Special)
	Q_PROP_DECL(QString, SaveBonus)
	Q_PROP_DECL(QString, Notes)

public: 
    QList<SkillModel *>& PrimarySkills() { return _PrimarySkills; } 
	void setPrimarySkills(const QList<SkillModel *>& value) { _PrimarySkills = value; } 
    QList<SkillModel *>& SecondarySkills() { return _SecondarySkills; } 
	void setSecondarySkills(const QList<SkillModel *>& value) { _SecondarySkills = value; } 
	QList<ExtraordinaryAbilityModel *>& ExtraordinaryAbilities() { return _ExtraordinaryAbilities; }
	void setExtraordinaryAbilities(const QList<ExtraordinaryAbilityModel *>& value) { _ExtraordinaryAbilities = value; }
	QList<WeaponProficiencyModel *>& WeaponProficiencies() { return _WeaponProficiencies; }
	void setWeaponProficiencies(const QList<WeaponProficiencyModel *>& value) { _WeaponProficiencies = value; }
	QList<EquipmentModel *>& Equipment() { return _Equipment; }
	void setEquipment(const QList<EquipmentModel *>& value) { _Equipment = value; }

private: 
	QList<SkillModel *> _PrimarySkills;
	QList<SkillModel *> _SecondarySkills;
	QList<ExtraordinaryAbilityModel *> _ExtraordinaryAbilities;
	QList<WeaponProficiencyModel *> _WeaponProficiencies;
	QList<EquipmentModel *> _Equipment;
#pragma endregion

#pragma region Public Methods and Operators

public:
	bool Serialize(QDomDocument * doc, QDomElement * tag);
	bool Deserialize(QDomDocument * doc, QDomElement * tag);

public:

#pragma endregion

#pragma region Helper Methods

private:

#pragma endregion

};

